﻿using System;
using UnityEngine;

namespace ParticlePlayground
{
	// Token: 0x0200016F RID: 367
	[Serializable]
	public class PlaygroundEventC
	{
		// Token: 0x14000018 RID: 24
		// (add) Token: 0x060008B7 RID: 2231 RVA: 0x000340D8 File Offset: 0x000322D8
		// (remove) Token: 0x060008B8 RID: 2232 RVA: 0x000340F4 File Offset: 0x000322F4
		public event OnPlaygroundParticle particleEvent;

		// Token: 0x060008B9 RID: 2233 RVA: 0x00034110 File Offset: 0x00032310
		public virtual void Initialize()
		{
			this.initializedTarget = (this.target != null && this.target.gameObject.activeSelf && this.target.gameObject.activeInHierarchy && this.target.enabled);
			this.initializedEvent = (this.particleEvent != null);
		}

		// Token: 0x060008BA RID: 2234 RVA: 0x00034180 File Offset: 0x00032380
		public virtual bool UpdateTime()
		{
			bool result = false;
			this.timer += PlaygroundC.globalDeltaTime;
			if (this.timer >= this.eventTime)
			{
				result = true;
				this.timer = 0f;
			}
			return result;
		}

		// Token: 0x060008BB RID: 2235 RVA: 0x000341C0 File Offset: 0x000323C0
		public virtual void SetTimer(float newTime)
		{
			this.timer = newTime;
		}

		// Token: 0x060008BC RID: 2236 RVA: 0x000341CC File Offset: 0x000323CC
		public virtual void SendParticleEvent(PlaygroundEventParticle eventParticle)
		{
			if (this.initializedEvent)
			{
				this.particleEvent(eventParticle);
			}
		}

		// Token: 0x060008BD RID: 2237 RVA: 0x000341E8 File Offset: 0x000323E8
		public virtual PlaygroundEventC Clone()
		{
			return new PlaygroundEventC
			{
				enabled = this.enabled,
				target = this.target,
				eventType = this.eventType,
				eventInheritancePosition = this.eventInheritancePosition,
				eventInheritanceVelocity = this.eventInheritanceVelocity,
				eventInheritanceColor = this.eventInheritanceColor,
				eventPosition = this.eventPosition,
				eventVelocity = this.eventVelocity,
				eventColor = this.eventColor,
				eventTime = this.eventTime,
				collisionThreshold = this.collisionThreshold,
				velocityMultiplier = this.velocityMultiplier,
				broadcastType = this.broadcastType
			};
		}

		// Token: 0x040008DD RID: 2269
		public bool enabled = true;

		// Token: 0x040008DE RID: 2270
		public bool sendToManager;

		// Token: 0x040008DF RID: 2271
		[NonSerialized]
		public bool initializedTarget;

		// Token: 0x040008E0 RID: 2272
		[NonSerialized]
		public bool initializedEvent;

		// Token: 0x040008E1 RID: 2273
		public PlaygroundParticlesC target;

		// Token: 0x040008E2 RID: 2274
		public EVENTBROADCASTC broadcastType;

		// Token: 0x040008E3 RID: 2275
		public EVENTTYPEC eventType;

		// Token: 0x040008E4 RID: 2276
		public EVENTINHERITANCEC eventInheritancePosition;

		// Token: 0x040008E5 RID: 2277
		public EVENTINHERITANCEC eventInheritanceVelocity;

		// Token: 0x040008E6 RID: 2278
		public EVENTINHERITANCEC eventInheritanceColor;

		// Token: 0x040008E7 RID: 2279
		public Vector3 eventPosition;

		// Token: 0x040008E8 RID: 2280
		public Vector3 eventVelocity;

		// Token: 0x040008E9 RID: 2281
		public Color32 eventColor = Color.white;

		// Token: 0x040008EA RID: 2282
		public float eventTime = 1f;

		// Token: 0x040008EB RID: 2283
		public float collisionThreshold = 10f;

		// Token: 0x040008EC RID: 2284
		public float velocityMultiplier = 1f;

		// Token: 0x040008ED RID: 2285
		protected float timer;
	}
}
